/**
 * 
 */
package unseen.games.model;

import java.util.List;

/**
 * @author PERRAUDIN Steven <sperraudin@neotilus.com>
 *
 * @date 16 juin 2010
 */
public class Score {

	private String mUsername;
	private int mScore;
	private int mDifficulty;
	
	public Score(){
	}
	
	public Score(String username, int score, int difficulty){
		mUsername 	= username;
		mScore 		= score;
		mDifficulty = difficulty;
	}
	
	public static List<Score> sort(List<Score> scores){
		
		int n = scores.size();
		for (int pass=1; pass < n; pass++) {
			for (int i=0; i < n-pass; i++) {
				if (scores.get(i).getScore() < scores.get(i+1).getScore()) {
		            Score temp = scores.get(i);
		            scores.set(i, scores.get(i+1));
		            scores.set(i+1, temp);
				}
			}
		}
		
		return scores;
	}
	

	/**
	 * @return the mUsername
	 */
	public String getUsername() {
		return mUsername;
	}

	/**
	 * @param mUsername the mUsername to set
	 */
	public void setUsername(String mUsername) {
		this.mUsername = mUsername;
	}

	/**
	 * @return the mScore
	 */
	public int getScore() {
		return mScore;
	}

	/**
	 * @param mScore the mScore to set
	 */
	public void setScore(int mScore) {
		this.mScore = mScore;
	}

	/**
	 * @return the mDifficulty
	 */
	public int getDifficulty() {
		return mDifficulty;
	}

	/**
	 * @param mDifficulty the mDifficulty to set
	 */
	public void setDifficulty(int mDifficulty) {
		this.mDifficulty = mDifficulty;
	}
	
}
